#include <iostream>
#include <sys/types.h>
#include <sys/stat.h>

#include "c_client.h"

namespace dhd
{
namespace client
{

   // defined in c_fuse.cpp
   int run_fuse_main_loop( int argc, char *argv[] );
   
   
   int dhd_client_main(int argc, char *argv[])
   {
       int ret_val = 1;
       
       umask(0);    
       
       try
       {
           g_client = new Client( "frontend.cfg" );
           
           
           ret_val = run_fuse_main_loop( argc, argv );
           
           
           delete g_client;
           g_client = 0;
       }
       catch( ConfigurationError & e )
       {
           std::cerr << "Error in configuration file on line " << e.line << std::endl;
           std::cerr << "    " << e.what() << std::endl;
           std::cerr << "Exiting." << std::endl;
       }
       
       return ret_val;
   }


}// end namespace dhd::client
}// end namespace dhd



int main(int argc, char *argv[])
{
    return dhd::client::dhd_client_main(argc, argv);
}




